<script setup lang='ts'>
import ChildOne from './components/ChildOne.vue';
import ChildTwo from './components/ChildTwo.vue';
import { useCounterStore } from './stores/counter';
const store = useCounterStore()
// const { channelList, getChannelList } = useCounterStore()
// 解构会丢失响应式
// 请求数据，直接点用请求数据的方法
store.getChannelList()
</script>

<template>
  <div>
    <ChildOne></ChildOne>
    <ChildTwo></ChildTwo>
  </div>
  <ul>
    <li v-for="item in store.channelList" :key="item.id">
      {{ item.name }}
    </li>
  </ul>
</template>

<style scoped></style>